package com.qys.livesMall.app.user.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author dp
 * @since 2023-04-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("h2_app_user")
@Schema(name = "H2AppUser对象", description = "用户")
public class H2AppUser implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @TableId("id")
    private String id;

    @Schema(description = "用户类型(0普通用户,1店主,2主播)")
    @TableField("user_type")
    private Integer userType;

    @Schema(description = "状态(0未冻结,1冻结)")
    @TableField("status")
    private Integer status;

    @Schema(description = "头像")
    @TableField("avatar")
    private String avatar;

    @Schema(description = "用户名")
    @TableField("user_name")
    private String userName;

    @Schema(description = "昵称")
    @TableField("nick_name")
    private String nickName;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @Schema(description = "密码盐")
    @TableField("salt")
    private String salt;

    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "电话")
    @TableField("mobile")
    private String mobile;

    @Schema(description = "上级id")
    @TableField("superior")
    private Long superior;

    @Schema(description = "上级名称")
    @TableField("superior_name")
    private String superiorName;

    @Schema(description = "用户提款密码")
    @TableField("user_withdrawal_password")
    private String userWithdrawalPassword;

    @Schema(description = "店铺提款密码")
    @TableField("store_withdrawal_password")
    private String storeWithdrawalPassword;

    @Schema(description = "主播提款密码")
    @TableField("anchor_withdrawal_password")
    private String anchorWithdrawalPassword;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    @Schema(description = "ip地址")
    @TableField("ip")
    private Long ip;

    @Schema(description = "最后登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;

    @Schema(description = "是否置顶")
    @TableField("top")
    private Boolean top;

    @Schema(description = "用户三方接口id")
    @TableField("union_id")
    private String unionId;

    @Schema(description = "邀请码5位英文大写")
    @TableField("invitation_code")
    private String invitationCode;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Schema(description = "创建人")
    @TableField("create_by")
    private String createBy;

    @Schema(description = "更新人")
    @TableField("update_by")
    private String updateBy;

    @Schema(description = "是否删除")
    @TableField("deleted")
    private Boolean deleted;

//    @Schema(description = "来源(0app,1水军)")
//    @TableField("source")
//    private Integer source;

    @Schema(description = "性别(0男,1女,2未知)")
    @TableField("gender")
    private Integer gender;

    @Schema(description = "个人介绍")
    @TableField("personal_introduction")
    private String personalIntroduction;

    @Schema(description = "年龄")
    @TableField("age")
    private Integer age;

    @Schema(description = "用户显示Id（用户账号）")
    @TableField("user_random_id")
    private String userRandomId;

    @Schema(description = "生日")
    @TableField("birthday")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;

    @Schema(description = "地址信息")
    @TableField("address")
    private String address;

    @Schema(description = "用户等级")
    @TableField("user_level")
    private String userLevel;

    @Schema(description = "用户等级")
    @TableField("user_level_id")
    private Long userLevelId;

    @Schema(description = "用户系统类型（0：水军，1：正常用户）")
    @TableField("user_sys_type")
    private Integer userSysType;

    @Schema(description = "主播id")
    @TableField(exist = false)
    private Long anchorId;

    @Schema(description = "谷歌账号")
    @TableField("google_account")
    private String googleAccount;

    @Schema(description = "脸书账号")
    @TableField("facebook_account")
    private String facebookAccount;

    @TableField(exist = false)
    @Schema(description = "上级账号")
    private String superiorUsername;

    @Schema(description = "ip地址字符串")
    @TableField(exist = false)
    private String ipStr;

    @TableField("live_view_permission")
    @Schema(description = "直播观看权限（1：有，0：无）")
    private Integer liveViewPermission;
}
